var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", "js/general_functions.js");
document.getElementsByTagName("head")[0].appendChild(script);


function cauhoi_import(){
    var file = $("#import_file").val();
    var extension = file.split('.').pop().toLowerCase();
    if( $.inArray(extension, ['xml', 'txt']) == -1 )  {
        document.getElementById("import_ketqua").innerHTML = "File không hợp lệ. Xin chọn file xml.";
        return false;
    }
    else
        return true;
}

function cauhoi_export(){
    document.getElementById("export_ketqua").innerHTML = "đang export ...";
    xmlhttp = createXMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById("export_ketqua").innerHTML = xmlhttp.responseText;
        }
    }
    var serverURL = "gui_handling/cauhoi_export.jsp?t=" + (new Date()).getTime();
    xmlhttp.open("GET",serverURL,true);
    xmlhttp.send();
}